/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package control;

import java.sql.SQLException;
import view.AddRecipePanel;
import view.SearchPanel;
import view.TLMGUI;

/**
 *
 * @author Jonas
 */
public class Start {

    public static IngredientHandler ih;
    public static RecipeHandler rh;

    /**
     * @param args the command line arguments
     */

    public static void main(String[] args) {
	try {
	    DBLogin db = new DBLogin();
	    System.out.println("DB Forbundet");

	    ih = new IngredientHandler(db);
	    ih.createIngredientList();
	    rh = new RecipeHandler(db);
	    rh.createRecipeList();
	    rh.showAll();

	    AddRecipePanel ap = new AddRecipePanel();
	    SearchPanel sp = new SearchPanel(rh);

	    TLMGUI gui = new TLMGUI(sp, ap);
	    gui.setVisible(true);

	} catch (SQLException ex) {
	    System.out.println("SQL FEJL");
	} catch (ClassNotFoundException ex) {
	    System.out.println("Driver fejl");
	}
    }
}
